package com.example.myapplication.utils;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

public class IP {
    public static String NOW_IP = "http://10.20.252.243:8080";
    private String IP1 = "http://192.168.137.125:8080";
    public static String zlip = "http://10.20.241.109:8080";

    public static List<String> getIpList() {
        List <String> ipList = new ArrayList<>();
        IP ip = new IP();
        Field[] declaredFields = IP.class.getDeclaredFields();
        for (int i = 0; i < declaredFields.length; i++) {
            Field declaredField = declaredFields[i];
            declaredField.setAccessible(true);
            try {
                Object o = declaredField.get(ip);
                ipList.add(o.toString());
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
        }
        return ipList;
    }
}
